package com.hangjiang.gulidear.model;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * Extraworkapplication entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "extraWork", catalog = "sqm")
public class ExtraWorkApplication extends BaseEntity {

	// Fields

	private String appId;
	private Project project;
	private User user;
	private String appTitle;
	private String appReason;
	private Timestamp appTime;
	private Timestamp workStart;
	private Timestamp workEnd;
	private Integer status;

	// Constructors

	/** default constructor */
	public ExtraWorkApplication() {
	}

	/** full constructor */
	public ExtraWorkApplication(Project project, User user, String appTitle,
			String appReason, Timestamp appTime, Timestamp workStart,
			Timestamp workEnd, Integer status) {
		this.project = project;
		this.user = user;
		this.appTitle = appTitle;
		this.appReason = appReason;
		this.appTime = appTime;
		this.workStart = workStart;
		this.workEnd = workEnd;
		this.status = status;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "appId", unique = true, nullable = false, length = 32)
	public String getAppId() {
		return this.appId;
	}

	public void setAppId(String appId) {
		this.appId = appId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "projId")
	public Project getProject() {
		return this.project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "appTitle", length = 30)
	public String getAppTitle() {
		return this.appTitle;
	}

	public void setAppTitle(String appTitle) {
		this.appTitle = appTitle;
	}

	@Column(name = "appReason", length = 200)
	public String getAppReason() {
		return this.appReason;
	}

	public void setAppReason(String appReason) {
		this.appReason = appReason;
	}

	@Column(name = "appTime", length = 0)
	public Timestamp getAppTime() {
		return this.appTime;
	}

	public void setAppTime(Timestamp appTime) {
		this.appTime = appTime;
	}

	@Column(name = "workStart", length = 0)
	public Timestamp getWorkStart() {
		return this.workStart;
	}

	public void setWorkStart(Timestamp workStart) {
		this.workStart = workStart;
	}

	@Column(name = "workEnd", length = 0)
	public Timestamp getWorkEnd() {
		return this.workEnd;
	}

	public void setWorkEnd(Timestamp workEnd) {
		this.workEnd = workEnd;
	}

	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

}